﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Streambolics
{
    public class JobQueue<T> : SimpleComputingModule where T : Job
    {
        private Queue<T> _Queue = new Queue<T>();

        public T Pop ()
        {
            if (!IsRunning || _Queue.Count == 0)
            {
                return default (T);
            }
            return _Queue.Dequeue();
        }

        public void Push (T aQuery)
        {
            _Queue.Enqueue (aQuery);
        }
    }
}
